
package jfireeagle.examples.swing;

import javax.swing.JPanel;
import javax.swing.JTextField;

import jfireeagle.FireEagleClient;

public class AbstractPanel extends JPanel
{
	protected FireEagleClient client;

	
	
	public FireEagleClient getClient()
	{
		return client;
	}


	public void setClient(FireEagleClient c)
	{
		this.client = c;
	}


	public AbstractPanel(FireEagleClient c)
	{
		this.client = c;
	}

	protected boolean hasText(JTextField field)
	{
		return !isEmpty(field);
	}
	
	protected boolean isEmpty(JTextField field)
	{
		if (field.getText() == null)
		{
			return true;
		}
		else if (field.getText().trim().length() == 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
}
